package com.ruitu.health.mvp.model;

import com.ruitu.arad.api.RxUtil;
import com.ruitu.arad.base.BaseModel;
import com.ruitu.health_2.dao.http.APIRetrofit;
import com.ruitu.router_module.bean.BaseResult2;
import com.ruitu.router_module.bean.PageModel2;
import com.ruitu.router_module.bean.home.HomeData;
import com.ruitu.router_module.bean.home.ReadPartie;
import com.ruitu.router_module.bean.product.ArtiVideo;
import com.ruitu.router_module.bean.product.ProHome;

import io.reactivex.Observable;

public class HomeModel {

    public static class HomeM extends BaseModel {
        public Observable<BaseResult2<HomeData>> reqHomeFata() {
            return APIRetrofit.getDefault()
                    .reqHomeData()
                    .compose(RxUtil.<BaseResult2<HomeData>>subIoObMain());
        }

        public Observable<BaseResult2<PageModel2<ProHome>>> reqHomeTab1(String tabId, int size, int num) {
            return APIRetrofit.getDefault()
                    .reqHomeTab1(tabId, size, num)
                    .compose(RxUtil.<BaseResult2<PageModel2<ProHome>>>subIoObMain());
        }

        public Observable<BaseResult2<PageModel2<ReadPartie>>> reqHomeTab2(String tabId, int size, int num) {
            return APIRetrofit.getDefault()
                    .reqHomeTab2(tabId, size, num)
                    .compose(RxUtil.<BaseResult2<PageModel2<ReadPartie>>>subIoObMain());
        }

        public Observable<BaseResult2<PageModel2<ArtiVideo>>> reqHomeTab3(String tabId, int size, int num) {
            return APIRetrofit.getDefault()
                    .reqHomeTab3(tabId, size, num)
                    .compose(RxUtil.<BaseResult2<PageModel2<ArtiVideo>>>subIoObMain());
        }
    }
}
